import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;

/**
 * Created with IntelliJ IDEA.
 * Description: 文件流，字节的写操作
 */
public class Demo9 {
    public static void main(String[] args) {
        //每次按照写方式打开文件，都会清空原有文件的内容
        try(OutputStream outputStream = new FileOutputStream("d:/test.txt")) {
            /*outputStream.write(99);
            outputStream.write(100);*/
            byte[] buffer = {99,100,101};
            outputStream.write(buffer);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
